import java.util.ArrayList;
import java.util.List;

public class postman implements Observable {

    private List<Observer> observerList = new ArrayList<Observer>();

    @Override
    public void add(Observer observer) {
        if (observer == null) {
            throw new NullPointerException();
        } else {
            if (!observerList.contains(observer)) {
                observerList.add(observer);
            }
        }
    }

    @Override
    public void remove(Observer observer) {
        observerList.remove(observer);
    }

    @Override
    public void notify(String message) {
        for(Observer o:observerList){
            o.update(message);
        }
    }
}
